package file;

import java.io.FileOutputStream;
import java.io.IOException;

public class FinallyDemo2 {
    public static void main(String[] args) {
        FileOutputStream fio = null;
        try {
            fio = new FileOutputStream("fos.dat");
            fio.write(1);
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                if (fio != null){
                fio.close();}
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}